package com.swpu.cbg.springcard.wxapi;

import android.app.Activity;
import android.os.Bundle;

import com.tencent.mm.sdk.openapi.WXTextObject;
import com.swpu.cbg.springcard.MainActivity;
import com.swpu.cbg.springcard.R;
import com.tencent.mm.sdk.openapi.BaseReq;
import com.tencent.mm.sdk.openapi.BaseResp;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.sdk.openapi.WXAPIFactory;

/**
 * Created by chenboge on 16/2/28.
 */
public class WXEntryActivity extends Activity implements IWXAPIEventHandler {

    private static final java.lang.String APP_KEY = "";
    private IWXAPI api;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        api = WXAPIFactory.createWXAPI(this, APP_KEY, false);
        api.handleIntent(getIntent(), this);
        super.onCreate(savedInstanceState);
    }

    @Override
    public void onReq(BaseReq baseReq) {

    }

    @Override
    public void onResp(BaseResp baseResp) {
        switch (baseResp.errCode) {
            case BaseResp.ErrCode.ERR_OK:
                //分享成功
                break;

            case BaseResp.ErrCode.ERR_SENT_FAILED:

                break;

            case BaseResp.ErrCode.ERR_USER_CANCEL:
                //分享取消
                break;

            case BaseResp.ErrCode.ERR_AUTH_DENIED:
                //分享拒绝
                break;
        }
    }
}
